package com.example.handheld4_gsignal_app.config;

/**
 * API配置类 - 管理服务器地址和配置
 */
public class ApiConfig {
    
    // 服务器配置
    public static final String DEFAULT_BASE_URL = "http://101.201.68.169:8886/";
    public static final String LOCAL_BASE_URL = "http://10.0.2.2:8886/"; // Android模拟器访问本地服务器
    public static final String PRODUCTION_BASE_URL = "http://101.201.68.169:8886/";
    
    // 当前使用的服务器地址
    public static final String CURRENT_BASE_URL = DEFAULT_BASE_URL;
    
    // 超时配置
    public static final int CONNECT_TIMEOUT_SECONDS = 30;
    public static final int READ_TIMEOUT_SECONDS = 30;
    public static final int WRITE_TIMEOUT_SECONDS = 30;
    
    // 分页配置
    public static final int DEFAULT_PAGE_SIZE = 100;
    public static final int MAX_PAGE_SIZE = 1000;
    
    // 设备配置
    public static final String DEFAULT_DEVICE_ID = "DEVICE_001";
    
    /**
     * 获取当前服务器地址
     */
    public static String getBaseUrl() {
        return CURRENT_BASE_URL;
    }
    
    /**
     * 检查是否为本地开发环境
     */
    public static boolean isLocalDevelopment() {
        return CURRENT_BASE_URL.equals(LOCAL_BASE_URL);
    }
    
    /**
     * 检查是否为生产环境
     */
    public static boolean isProduction() {
        return CURRENT_BASE_URL.equals(PRODUCTION_BASE_URL);
    }
}